package com.szmg.wishwalls.dao;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.szmg.common.BaseDao;
import com.szmg.wishwalls.model.Menu;

@Component("menuDao")
public class MenuDao extends BaseDao{
	/**
	 * 获取活动相关的所有根节点数据
	 * @param programCode
	 * @return
	 */
	public List<Menu> queryProgramBaseMenu(String programCode){
		return this.readSqlSession.selectList("com.szmg.wishwalls.dao.MenuDao.queryProgramBaseMenu",programCode);
	}
	
	/**
	 * 根据菜单父节点id，获取对应的子节点
	 * @param programCode
	 * @param parentId
	 * @return
	 */
	public List<Menu> queryMenuByParentId(String programCode,String parentId){
		Map<String,String> map = new HashMap<String,String>();
		map.put("programCode", programCode);
		map.put("parentId", parentId);
		return this.readSqlSession.selectList("com.szmg.wishwalls.dao.MenuDao.queryMenuByParentId",map);
	}
	
}
